package referenceTest;

public class M {

    private byte[] b;
    private String name;
    public M(int size, String name) {
        this.name = name;
        b = new byte[1024 * 1024 * size];
    }
    //垃圾回收时会执行这个函数
    @Override
    protected void finalize() throws Throwable {
        System.out.println(this.name+"被回收");
    }
}
